function popWindow(pUrl, pw, ph) {
	// function pops a window given a url, width and height, and centers it in the monitor

	sw = screen.availWidth;
	sh = screen.availHeight;
   
	leftpos = (sw - pw) / 2;
	toppos = (sh - ph) / 2;
 
	if (!popwin || popwin.closed) {
		pStr = "left=" + leftpos + ",top=" + toppos + ",width=" + pw + ",height=" + ph + ",scrollbars=yes";
		var popwin = window.open(pUrl,"popup",pStr);
	} else {
		popwin.location = pUrl;
		popwin.focus();
	}
}

function addLoadEvent(_function) {
	var _onload = window.onload;
	if (typeof window.onload != "function") {
		window.onload = _function;
	} else {
		window.onload = function() {
			_onload();
			_function();
		}
	}
}

function loadEditor(key) {
	eval("var _ed" + key + " = new FCKeditor('" + key + "');");
	eval("_ed" + key + ".BasePath = fckEditorPath;");
	eval("_ed" + key + ".Config['status'] = 'LOADED';");
	eval("_ed" + key + ".ReplaceTextarea();");
}